/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package l1j.jrwz.server.serverpackets;

import l1j.jrwz.server.Opcodes;
import l1j.jrwz.server.model.Instance.L1PetInstance;

/**
 * Class <code>S_PetEquipment</code> 宠物装备.
 * 
 * @author jrwz
 * @version 2012-12-10上午8:36:34
 * @see l1j.jrwz.server.serverpackets
 * @since JDK1.7
 */
public class S_PetEquipment extends ServerBasePacket {
    private static final String S_PET_EQUIPMENT = "[S] S_PetEquipment";
    private byte[] _byte = null;

    /**
     * 宠物装备.
     * 
     * @param i
     *            - 资料
     * @param pet
     *            - 宠物
     * @param j
     *            -
     */
    public S_PetEquipment(final int i, final L1PetInstance pet, final int j) {
        /**
         * 【Client】 id:60 size:8 time:1302335819781
         * 0000 3c 00 04 bd 54 00 00 00 <...T...
         * 【Server】 id:82 size:16 time:1302335819812
         * 0000 52 25 00 04 bd 54 00 00 0a 37 80 08 7e ec d0 46 R%...T...7..~..F
         */
        writeC(Opcodes.S_OPCODE_PACKETBOX);
        writeC(S_PacketBox.PET_EQUIPMENT);
        writeC(i);
        writeD(pet.getId());
        writeC(j);
        writeC(pet.getAc()); // 宠物防御
    }

    @Override
    public byte[] getContent() {
        if (_byte == null) {
            _byte = getBytes();
        }
        return _byte;
    }

    @Override
    public String getType() {
        return S_PET_EQUIPMENT;
    }
}
